<template>
	<view class="cardbag">
		<u-navbar title="我的卡包" title-color="white" :title-size="35" :title-bold="true" :immersive="true"
			:background="background" :border-bottom="false"></u-navbar>

		<view class="items">
			<image src="https://gongxiangtaiqiu.axa2.com/taiqiu/vvvvvip.png" style="width: 100%; height: 100%;">
			</image>
			<view class="left-img">
				<image src="https://gongxiangtaiqiu.axa2.com/taiqiu/putongvip.png" style="width: 100%; height: 100%;">
				</image>
			</view>
			<view
				style="display: flex; justify-content: center; height: 45px; position: absolute; top: 20px;  left: 50px;">
				<view class="vip">{{cardList.has_card.f_card_name?cardList.has_card.f_card_name:''}}</view>
				<view class="card1">（{{cardList.has_card.f_discount?cardList.has_card.f_discount:''}}）</view>
			</view>
			<view class="card" style="position: absolute; left: 20px; top: 73px;">充值金额：{{cardList.has_card.f_condition?cardList.has_card.f_condition:''}}元
			</view>
			<view class="card" style="position: absolute; left: 20px; top: 100px;">卡券说明：{{cardList.has_card.f_intro?cardList.has_card.f_intro:''}}</view>
		</view>

	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				cardList: {},
			};
		},
		onLoad() {
			if (uni.getStorageSync('shop_id') == '') {
				uni.showToast({
					title: '请先选择店铺哦',
					icon: 'none'
				})
				setTimeout(() => {
					uni.navigateBack({
						delta: 1
					})
				}, 1000)
			}
			this.$Api.getMyMemberCard({
				userId: uni.getStorageSync('userid'),
				shopId: uni.getStorageSync('shop_id'),
			}).then(res => {
				console.log(res.data.data, '12121212')
				this.cardList = res.data.data
				if (res.data.data==null) {
					uni.showToast({
						title: '当前店铺暂无会员卡',
						icon: 'none'
					})
					setTimeout(() => {
						uni.navigateBack({
							delta: 1
						})
					}, 1000)
				}
				// console.log(res.data.data, '12121212')
			});
		},
		methods: {

		},
	};
</script>

<style lang="scss">
	.items {
		width: 665rpx;
		height: 266rpx;
		margin: auto;
		margin-top: 200rpx;
		position: relative;

		.card {
			// width: 85px;
			height: 22px;
			font-size: 12px;
			font-family: PingFang SC;
			color: #ffc9a7;
			position: absolute;
			top: 45px;
			left: 170px;

		}

		.card1 {
			// width: 85px;
			height: 22px;
			font-size: 12px;
			font-family: PingFang SC;
			color: #ffc9a7;
			line-height: 65px;
			// position: absolute;
			// top: 45px;
			// left: 170px;

		}

		.left-img {
			width: 20px;
			height: 17px;
			position: absolute;
			top: 33px;
			left: 25px;
		}

		.vip {
			// width: 172px;
			height: 42px;
			font-size: 28px;
			font-family: MiSans;
			font-weight: 800;
			font-style: italic;
			color: #ffc9a7;
			line-height: 48px;
			// position: absolute;
			// top: 20px;
			// left: 55px;
		}
	}

	page {
		background: #000000;
	}

	.cardbag {
		width: 100%;
		height: auto;

		.item {
			width: 695rpx;
			height: 266rpx;
			margin: auto;
			margin-top: 30rpx;
		}
	}
</style>
